const express = require('express')
const router = express.Router()
const Category = require('../models/Category')

/**
 * 查询所有分类
 */
router.get('/', function(req, res, next) {
  Category
    .find({}, {_id: false, __v: false})
    .then(data => {
      res.json({
        code: 200,
        data: {
          list: data
        }
      })
    })
})

module.exports = router
